package com.rad.datastat.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;

import com.rad.datastat.service.DatastatService;
import com.rad.net.protocol.android.utils.LogUtils;

public class NetworkStateReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		if (null != intent) {
			if (ConnectivityManager.CONNECTIVITY_ACTION.equals(intent
					.getAction())) {
				LogUtils.e("RadStatistics", "NetworkStateReceiver startDatastatService");
				Intent i = new Intent(context, DatastatService.class);
				context.startService(i);
			}
		}
	}
}
